<template>
  <div>
    <!-- 路由组件显示区域 -->
    <router-view></router-view>
    <!-- 底部标签栏 -->
    <van-tabbar v-model="active" active-color="#ee0a24" inactive-color="#000" route fixed placeholder z-index="101">
      <van-tabbar-item replace :to="{name: 'home'}" icon="home-o">主页</van-tabbar-item>
      <van-tabbar-item replace :to="{name: 'category'}" icon="bars">分类</van-tabbar-item>
      <van-tabbar-item replace :to="{name: 'cart'}" icon="cart-o">购物车</van-tabbar-item>
      <van-tabbar-item replace :to="{name: 'user'}" icon="user-circle-o">用户</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import { Tabbar, TabbarItem } from 'vant' // 底部标签栏组件

export default {
  name: 'Container',
  components: {
    [Tabbar.name]: Tabbar,
    [TabbarItem.name]: TabbarItem,
  },
  data() {
    return {
      active: 0, // 底部标签栏激活标签索引
    }
  },
}
</script>

<style>

</style>